using System.ComponentModel.DataAnnotations.Schema;
using System.Data.Entity.ModelConfiguration;

namespace ConsoleApplication2.Models.Mapping
{
    public class So_Pr_No_ARMap : EntityTypeConfiguration<So_Pr_No_AR>
    {
        public So_Pr_No_ARMap()
        {
            // Primary Key
            this.HasKey(t => new { t.Receipt__, t.DATE, t.Vendor });

            // Properties
            this.Property(t => t.Receipt__)
                .IsRequired()
                .HasMaxLength(7);

            this.Property(t => t.Order__)
                .HasMaxLength(8);

            this.Property(t => t.Vendor)
                .IsRequired()
                .HasMaxLength(35);

            this.Property(t => t.Vendor__)
                .HasMaxLength(6);

            this.Property(t => t.Vendor_Invoice__)
                .HasMaxLength(8);

            this.Property(t => t.batch)
                .HasMaxLength(10);

            // Table & Column Mappings
            this.ToTable("So_Pr_No_AR");
            this.Property(t => t.Receipt__).HasColumnName("Receipt_#");
            this.Property(t => t.Order__).HasColumnName("Order_#");
            this.Property(t => t.DATE).HasColumnName("DATE");
            this.Property(t => t.Vendor).HasColumnName("Vendor");
            this.Property(t => t.Vendor__).HasColumnName("Vendor_#");
            this.Property(t => t.Vendor_Invoice__).HasColumnName("Vendor_Invoice_#");
            this.Property(t => t.batch).HasColumnName("batch");
            this.Property(t => t.CLOSED).HasColumnName("CLOSED");
            this.Property(t => t.Doc_date).HasColumnName("Doc_date");
            this.Property(t => t.Note).HasColumnName("Note");
        }
    }
}
